package components.tools
{
	import UIFree.controls.uif_label;
	import UIFree.uif_component;
	
	import components.c_component;
	
	import flash.geom.Rectangle;
	
	public class c_layerItem extends c_component {
		public static const HEIGHT: int = 25;
		private var _caption: uif_label;
		public function c_layerItem(parent:uif_component, ay:int, item: Object) {
			var inner: Rectangle = parent.getInner();
			super(parent, inner.x, inner.y + ay, inner.width, HEIGHT, 'layerItem');
			itemData = item;
		}
		
		public function get itemData(): Object {
			return _data;
		}
		
		public function set itemData(a_item: Object): void {
			_data = a_item;
			updateComponents();
		} 
		
		override protected function createComponents():void {
			var inner : Rectangle = getInner();
			_caption = new uif_label(this, inner.x, inner.y, inner.width, inner.height, style.caption) 
		}
		
		protected function updateComponents(): void {
			_caption.text = itemData.name;
		}
	}
}